# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>

_name=aiostream
pkgname=python-aiostream
pkgver=0.4.5
pkgrel=3
pkgdesc="Generator-based operators for asynchronous iteration"
arch=('any')
url=https://github.com/vxgmichel/aiostream
license=('GPL3')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
checkdepends=('python-pytest' 'python-pytest-asyncio')
source=("git+$url.git#tag=v$pkgver")
b2sums=('SKIP')

build() {
  cd $_name
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest tests --strict-markers -c /dev/null
}

package() {
  cd $_name
  python -m installer --destdir="$pkgdir" dist/*.whl
}
